package pers.zh.parking.data.entity;

import pers.zh.parking.R;
import pers.zh.parking.data.enums.RecordStatus;

public class ParkRecord {

    private int recordId;

    private long lotId;

    private long spaceId;

    private String carNo;

    private String entryTime;

    private String leaveTime;

    private String reserveTime;

    private int status;

    private long userId;

    private long fees;

    private int duration;

    private ParkingLot lot;

    public int getStatus() {
        return status;
    }

    private Evaluation evaluation;

    public RecordStatus getStatusEnum() {
        return RecordStatus.parse(status);
    }

    public String getStatusStr() {
        switch (getStatusEnum()) {
            case RESERVING:
                return "已预约";
            case CANCEL:
                return "已取消";
            case PARKING:
                return "泊车中";
            case LEAVED:
                return "已完成";
            case EVALUATED:
                return "已评价";
            default:
                return "未知";
        }
    }

    public int getRecordId() {
        return recordId;
    }

    public void setRecordId(int recordId) {
        this.recordId = recordId;
    }

    public long getLotId() {
        return lotId;
    }

    public void setLotId(long lotId) {
        this.lotId = lotId;
    }

    public long getSpaceId() {
        return spaceId;
    }

    public void setSpaceId(long spaceId) {
        this.spaceId = spaceId;
    }

    public String getCarNo() {
        return carNo == null ? "" : carNo;
    }

    public void setCarNo(String carNo) {
        this.carNo = carNo == null ? null : carNo.trim();
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public long getFees() {
        return fees;
    }

    public void setFees(long fees) {
        this.fees = fees;
    }

    public String getEntryTime() {
        return entryTime == null ? "" : entryTime;
    }

    public void setEntryTime(String entryTime) {
        this.entryTime = entryTime;
    }

    public String getLeaveTime() {
        return leaveTime == null ? "" : leaveTime;
    }

    public void setLeaveTime(String leaveTime) {
        this.leaveTime = leaveTime;
    }

    public String getReserveTime() {
        return reserveTime == null ? "" : reserveTime;
    }

    public void setReserveTime(String reserveTime) {
        this.reserveTime = reserveTime;
    }

    public ParkingLot getLot() {
        return lot;
    }

    public void setLot(ParkingLot lot) {
        this.lot = lot;
    }

    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public Evaluation getEvaluation() {
        return evaluation;
    }

    public void setEvaluation(Evaluation evaluation) {
        this.evaluation = evaluation;
    }
}
